<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true"%>
<!DOCTYPE html>
<html lang=ko>
<head>
<meta charset=UTF-8 />
<meta name=viewport content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
<meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1" />
<link rel="shortcut icon" href=assets/ico/favicon.png />
<link rel=apple-touch-icon-precomposed href=assets/ico/apple-touch-icon-57-precomposed.png />
<link rel=apple-touch-icon-precomposed sizes=72x72 href=assets/ico/apple-touch-icon-72-precomposed.png />
<link rel=apple-touch-icon-precomposed sizes=114x114 href=assets/ico/apple-touch-icon-114-precomposed.png />
<link rel=apple-touch-icon-precomposed sizes=144x144 href=assets/ico/apple-touch-icon-144-precomposed.png />
<link rel=stylesheet href=assets/css/bootstrap.min.css />
<link rel=stylesheet href=http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css />
<link rel=stylesheet type=text/css href=assets/css/nanumfont.css />
<link rel=stylesheet href=assets/font-awesome-4.0.3/css/font-awesome.min.css />
<!--[if lt IE 9]>
<script type=text/javascript src=assets/js/html5shiv.js></script>
<script type=text/javascript src=assets/js/respond.min.js></script>
<![endif]-->
<!--[if gt IE 9]>
<link rel=stylesheet type=text/css href=assets/css/ie10.css />
<script type=text/javascript src=assets/js/ie10.js></script>
<![endif]-->
<title>알랴쥼</title>
<link rel=stylesheet href=assets/css/index.css>
</head>
<body onload=init()>
<div class=popup-settime>
<form method=post action=#>
<div class=row>
<div class="col-md-6 col-sm-6 col-xs-6">
<a class="plus_btn text-center" onclick=in_hour()><i class="fa fa-plus"></i></a>
</div>
<div class="col-md-6 col-sm-6 col-xs-6">
<a class="plus_btn text-center" onclick=in_min()><i class="fa fa-plus"></i></a>
</div>
</div>
<div class=row>
<div class="col-md-6 col-sm-6 col-xs-6 text-center">
<input id=hour-setted class="input_time text-center" type=number min=-1 max=24 value=""/>
</div>
<div class="col-md-6 col-sm-6 col-xs-6 text-center">
<input id=min-setted class="input_time text-center" type=number min=-1 max=60 value />
</div>
</div>
<div class=row>
<div class="col-md-6 col-sm-6 col-xs-6">
<a class="minu_btn text-center" onclick=de_hour()><i class="fa fa-minus"></i></a>
</div>
<div class="col-md-6 col-sm-6 col-xs-6">
<a class="minu_btn text-center" onclick=de_min()><i class="fa fa-minus"></i></a>
</div>
</div>
<hr />
<a class="btn btn-primary btn-block" onclick=input_time()>완료</a>
</form>
</div>
<div class=popup-box>
<div class=text-center>
<p>현재 내 위치를</p>
<p>검색창에 입력하시겠습니까?</p>
</div>
<hr/>
<div class="row text-center">
<botton class="pop1 btn btn-primary popup-sl col-md-6 col-sm-6 col-xs-6" onfocus=blur()>출발지로</botton>
<botton class="pop1 btn btn-primary popup-el col-md-6 col-sm-6 col-xs-6">도착지로</botton>
</div>
</div>
<div class="navbar navbar-fixed-top navbar_style" role=navigation>
<div class=nav_content>
<div class="menu_switch nav_menu_btn pull-left text-center">
<a href=# id=quick_menu_switch><i id=menu_icon class="fa fa-plus"></i></a>
</div>
<div id=logo class=arryazum_logo>
</div>
<div id=sub_menu class="hidden text-center sub_menu_outer">
<div class="sub_menu_inner text-center pull-left">
<a href=metro_route.jsp class=nav-btn><i class="fa fa-desktop"></i></a>
</div>
<div class="sub_menu_inner text-center pull-left">
<a href=RoutLibrary.jsp class=nav-btn><i class="fa fa-flag"></i></a>
</div>
<div class="sub_menu_inner text-center pull-left">
<a href=option.jsp class=nav-btn><i class="fa fa-cog"></i></a>
</div>
</div>
<div class="project_info_btn nav_menu_btn pull-right text-center">
<a href=#><i class="fa fa-info"></i></a>
</div>
</div>
</div>
<div class=content>
<form class="form-signin form_style" method=post action=select_result.jsp>
<input type=hidden name=start id=startgps>
<input type=hidden name=end id=endgps>
<div class=input-group>
<input name=start_location id=sl type=text class="form-control input-top txt_box_style" placeholder=출발지>
<span class=input-group-btn>
<button class="input-search btn btn-default input-btn input-btn-top input-btn-style" type=button><i class="fa fa-search"></i></button>
</span>
</div>
<div class=input-group>
<input name=end_location id=el type=text class="form-control input-bottom txt_box_style" placeholder=도착지>
<span class=input-group-btn>
<button class="input-search btn btn-default input-btn input-btn-middle input-btn-style" type=button><i class="fa fa-search"></i></button>
</span>
</div>
<div id=set-time class="input-group set-time time_box">
</div>
<div class=btns_box>
<button id=my_pos class="btn btn-default btn-helper" type=button><i class="fa fa-crosshairs"></i></button>
<button class="btn btn-default btn-helper" type=button onclick="location.href='BookMark.jsp'"><i class="fa fa-map-marker"></i></button>
<button id=search-route-btn class="btn btn-warning pull-right" type=submit>경로 검색</button>
</div>
</form>
</div>
<div id=test></div>
<script src=assets/js/jquery.js></script>
<script src=http://code.jquery.com/ui/1.10.3/jquery-ui.js></script>
<script src=assets/js/bootstrap.min.js></script>
<script src=assets/js/string.js></script>
<script src=assets/js/index.js></script>
<script src=assets/js/db.js></script>
<script type=text/javascript>var alarmDB={};alarmDB.webdb={};alarmDB.webdb.db=null;alarmDB.webdb.open=function(){var a=1*1024*1024;alarmDB.webdb.db=openDatabase("alarmDB","1.0","알람DB",a)};alarmDB.webdb.createTable=function(){var a=alarmDB.webdb.db;a.transaction(function(b){b.executeSql("CREATE TABLE IF NOT EXISTS alarmDB(key TEXT, value TEXT)",[])})};alarmDB.webdb.addalarm=function(b,c){var a=alarmDB.webdb.db;a.transaction(function(d){d.executeSql("INSERT INTO alarmDB(key, value) VALUES (?,?)",[b,c],alarmDB.webdb.onSuccess,alarmDB.webdb.onError)})};alarmDB.webdb.onError=function(a,b){alert("There has been an error: "+b.message)};alarmDB.webdb.onSuccess=function(a,b){};alarmDB.webdb.getAllalarmItems=function(b){var a=alarmDB.webdb.db;a.transaction(function(c){c.executeSql("SELECT * FROM alarmDB",[],b,alarmDB.webdb.onError)})};function loadalarmList(a,b){if(b.rows.length<=0){alert("알람 초기화");alarmDB.webdb.addalarm("is_alarm",true);alarmDB.webdb.addalarm("set_time",5);alarmDB.webdb.addalarm("set_dis",30)}}var e_focus=0;function in_hour(){$("#hour-setted").val(Number($("#hour-setted").val())+1);if($("#hour-setted").val()==24){$("#hour-setted").val(0)}if($("#hour-setted").val()==-1){$("#hour-setted").val(23)}}function de_hour(){$("#hour-setted").val(Number($("#hour-setted").val())-1);if($("#hour-setted").val()==24){$("#hour-setted").val(0)}if($("#hour-setted").val()==-1){$("#hour-setted").val(23)}}function in_min(){$("#min-setted").val(Number($("#min-setted").val())+1);if($("#min-setted").val()==60){$("#min-setted").val(0)}if($("#min-setted").val()==-1){$("#min-setted").val(59)}}function de_min(){$("#min-setted").val(Number($("#min-setted").val())-1);if($("#min-setted").val()==60){$("#min-setted").val(0)}if($("#min-setted").val()==-1){$("#min-setted").val(59)}}function input_time(){var c=$("#input_time").val();var b=$("#hour-setted").val();var a=$("#min-setted").val();if(b<10){b="0"+b}if(a<10){a="0"+a}c=b+":"+a;$("#input_time").val(c);$(".popup-settime").dialog("close")}$(function(){alarmDB.webdb.open();alarmDB.webdb.createTable();alarmDB.webdb.getAllalarmItems(loadalarmList);setime();$("button").click(function(){if($("#sl").val().isValue()){if(sessionStorage.sl!=$("#sl").val()){sessionStorage.sl=$("#sl").val();sessionStorage.sg="";$("#sl").val(sessionStorage.sl);$("#startgps").val(sessionStorage.sg)}}if($("#el").val().isValue()){if(sessionStorage.el!=$("#el").val()){sessionStorage.el=$("#el").val();sessionStorage.eg="";$("#el").val(sessionStorage.el);$("#endgps").val(sessionStorage.eg)}}});$("#sl").val(sessionStorage.sl);$("#el").val(sessionStorage.el);$("#startgps").val(sessionStorage.sg);$("#endgps").val(sessionStorage.eg);$("input[type='text']").focus(function(){$("#quick_menu").hide()});$("input[type='text']").blur(function(){$("#quick_menu").show()});$("#my_pos").click(function(){$(".popup-box:eq(0)").dialog("open");$(".ui-dialog-titlebar-close").blur();$(".ui-dialog-titlebar-close").html('<i class="fa fa-times close-pop"></i>');$(".ui-dialog-title").html("내 위치");$(".popup-sl").click(function(){if(navigator.geolocation){e_focus=0;navigator.geolocation.getCurrentPosition(MyPosition,errorCallback)}$(this).parents(".popup-box").dialog("close");return false});$(".popup-el").click(function(){if(navigator.geolocation){e_focus=1;navigator.geolocation.getCurrentPosition(MyPosition,errorCallback)}$(this).parents(".popup-box").dialog("close");return false});$(".popup-close").click(function(){$(this).parents(".popup-box").dialog("close");return false});$(".ui-widget-overlay").click(function(){$(".popup-box:eq(0)").dialog("close")})});$("#set-time").click(function(){var b=new Date();var a=b.getHours();var c=b.getMinutes();if(a<10){a="0"+a}if(c<10){c="0"+c}$("#hour-setted").val(a);$("#min-setted").val(c);$("#hour-setted").change(function(){if($("#hour-setted").val()==24){$("#hour-setted").val(0)}if($("#hour-setted").val()==-1){$("#hour-setted").val(23)}});$("#min-setted").change(function(){if($("#min-setted").val()==60){$("#min-setted").val(0)}if($("#min-setted").val()==-1){$("#min-setted").val(59)}});$(".popup-settime").dialog("open");$(".ui-dialog-titlebar-close").html('<i class="fa fa-times close-pop"></i>');$(".ui-dialog-title").html("출발시간설정");$(".ui-dialog-titlebar-close").blur();$("#hour-setted").blur();$("#min-setted").blur();$(".ui-widget-overlay").click(function(){$(".popup-settime").dialog("close")});$(this).blur()});$(".input-btn-bottom").click(function(){var b=new Date();var a="";if(b.getHours()<10){a+="0"}a+=b.getHours();a+=":";if(b.getMinutes()<10){a+="0"}a+=b.getMinutes();$(".time").val(a)});$(document).on("click",'input[type="time"]',function(){alert("시계");return false})});function setime(){var b=new Date();var a="";a+='<input id="input_time" data-format="hh:mm" type="text" name="time" class="form-control time txt_box_style" value="';if(b.getHours()<10){a+="0"}a+=b.getHours();a+=":";if(b.getMinutes()<10){a+="0"}a+=b.getMinutes();a+='">';a+='<span class="input-group-btn">';a+='<button class="btn btn-default input-btn input-btn-bottom input-btn-style" type="button">';a+='<i class="fa fa-refresh"></i>';a+="</button>";a+="</span>";$(".set-time").html(a)}function MyPosition(a){var d=a.coords.latitude;var c=a.coords.longitude;var b="";$.ajax({url:"http://apis.daum.net/local/geo/coord2addr",data:{apikey:"0742d1ea1eab6220018c3f9716569897d5ec4ff5",longitude:c,latitude:d,output:"json",inputCoordSystem:"WGS84"},dataType:"jsonp",timeout:30000,cache:false,success:function(e){b=e.fullName;if(e_focus==1){$("#el").val(b);$("#endgps").val(d+","+c)}else{$("#sl").val(b);$("#startgps").val(d+","+c)}},error:function(g,e,f){alert("status: "+e+" / error-code: "+g.status+" "+f)}})}function errorCallback(a){alert(a.message)};</script>
</body>
</html>